<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>文章管理 - 社交平台</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    /* 基础样式 */
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background-color: #f5f7fa;
      color: #333;
      min-height: 100vh;
      margin: 0;
    }
    
    /* 顶部导航 */
    .top-nav {
      height: 50px;
      background-color: #fff;
      border-bottom: 1px solid #eee;
      display: flex;
      align-items: center;
      padding: 0 15px;
      position: sticky;
      top: 0;
      z-index: 100;
    }
    
    .nav-title {
      font-size: 18px;
      font-weight: 600;
      margin: 0 auto;
    }
    
    .nav-btn {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #666;
      text-decoration: none;
    }
    
    .nav-btn.primary {
      color: #3b82f6;
    }
    
    /* 文章概览 */
    .article-overview {
      background-color: #fff;
      padding: 15px;
      margin-bottom: 10px;
    }
    
    .overview-stats {
      display: flex;
      justify-content: space-between;
    }
    
    .stat-item {
      text-align: center;
      flex: 1;
    }
    
    .stat-value {
      font-size: 18px;
      font-weight: 700;
    }
    
    .stat-label {
      font-size: 12px;
      color: #999;
    }
    
    /* 样式切换器 */
    .style-switcher {
      background-color: #fff;
      padding: 12px 15px;
      border-bottom: 1px solid #eee;
    }
    
    .style-tabs {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      padding-bottom: 5px;
    }
    
    .style-tabs::-webkit-scrollbar {
      display: none;
    }
    
    .style-tab {
      padding: 6px 14px;
      background-color: #f5f7fa;
      border-radius: 20px;
      font-size: 14px;
      white-space: nowrap;
      cursor: pointer;
    }
    
    .style-tab.active {
      background-color: #3b82f6;
      color: white;
    }
    
    /* 通用文章页面样式 */
    .article-page {
      display: none;
    }
    
    .article-page.active {
      display: block;
    }
    
    /* 筛选栏 */
    .filter-bar {
      display: flex;
      padding: 10px 15px;
      background-color: white;
      border-bottom: 1px solid #eee;
      gap: 10px;
    }
    
    .filter-item {
      flex: 1;
      padding: 6px 0;
      text-align: center;
      font-size: 14px;
      position: relative;
    }
    
    .filter-item::after {
      content: "\f078";
      font-family: "FontAwesome";
      font-size: 12px;
      margin-left: 5px;
      color: #999;
    }
    
    /* 状态标签 */
    .status-tag {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 12px;
      font-weight: 500;
    }
    
    .status-published {
      background-color: #ecfdf5;
      color: #10b981;
    }
    
    .status-draft {
      background-color: #f3f4f6;
      color: #6b7280;
    }
    
    .status-pending {
      background-color: #fff3cd;
      color: #d97706;
    }
    
    .status-rejected {
      background-color: #fee2e2;
      color: #ef4444;
    }
    
    /* 操作按钮 */
    .action-btn {
      background: none;
      border: none;
      color: #666;
      font-size: 14px;
      padding: 4px 8px;
      border-radius: 4px;
      cursor: pointer;
    }
    
    .action-btn:hover {
      background-color: #f5f7fa;
    }
    
    .action-btn.edit {
      color: #3b82f6;
    }
    
    .action-btn.delete {
      color: #ef4444;
    }
    
    .action-btn.preview {
      color: #10b981;
    }
    
    /* 样式1 - 网格卡片视图 */
    .card-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 15px;
      padding: 15px;
    }
    
    .article-card {
      background-color: white;
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0,0,0,0.05);
      display: flex;
      flex-direction: column;
    }
    
    .card-img {
      width: 100%;
      height: 100px;
      object-fit: cover;
    }
    
    .card-body {
      padding: 12px;
      flex: 1;
      display: flex;
      flex-direction: column;
    }
    
    .card-title {
      font-size: 14px;
      font-weight: 500;
      margin: 0 0 8px 0;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    
    .card-meta {
      font-size: 11px;
      color: #999;
      margin-bottom: 8px;
    }
    
    .card-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: auto;
    }
    
    /* 样式2 - 紧凑列表视图 */
    .article-list {
      padding: 0;
      margin: 0;
      list-style: none;
    }
    
    .list-item {
      background-color: white;
      padding: 15px;
      border-bottom: 1px solid #eee;
      display: flex;
      align-items: center;
    }
    
    .list-img {
      width: 60px;
      height: 60px;
      border-radius: 8px;
      object-fit: cover;
      margin-right: 12px;
    }
    
    .list-content {
      flex: 1;
      display: flex;
      flex-direction: column;
    }
    
    .list-title {
      font-size: 15px;
      font-weight: 500;
      margin: 0 0 4px 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    .list-meta {
      font-size: 12px;
      color: #999;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    .list-actions {
      display: flex;
      gap: 5px;
    }
    
    /* 样式3 - 扩展列表视图 */
    .expanded-list {
      padding: 0 15px;
    }
    
    .expanded-item {
      background-color: white;
      border-radius: 12px;
      margin-bottom: 10px;
      overflow: hidden;
      box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    }
    
    .expanded-header {
      padding: 12px 15px;
      border-bottom: 1px solid #f5f7fa;
    }
    
    .expanded-title {
      font-size: 16px;
      font-weight: 500;
      margin: 0 0 5px 0;
    }
    
    .expanded-meta {
      font-size: 12px;
      color: #999;
      display: flex;
      justify-content: space-between;
    }
    
    .expanded-content {
      padding: 0 15px;
    }
    
    .expanded-excerpt {
      font-size: 14px;
      color: #666;
      padding: 10px 0;
      margin: 0;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    
    .expanded-footer {
      padding: 10px 15px;
      border-top: 1px solid #f5f7fa;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .expanded-stats {
      display: flex;
      gap: 15px;
      font-size: 12px;
      color: #666;
    }
    
    .expanded-actions {
      display: flex;
      gap: 8px;
    }
    
    /* 样式4 - 状态分组视图 */
    .status-group {
      margin-bottom: 15px;
    }
    
    .group-header {
      padding: 10px 15px;
      font-size: 14px;
      font-weight: 500;
      color: #666;
      background-color: #f5f7fa;
      display: flex;
      justify-content: space-between;
    }
    
    .group-count {
      background-color: #e5e7eb;
      color: #6b7280;
      font-size: 12px;
      padding: 1px 6px;
      border-radius: 10px;
    }
    
    .group-content {
      background-color: white;
    }
    
    .group-item {
      padding: 12px 15px;
      border-bottom: 1px solid #eee;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .group-title {
      font-size: 15px;
      font-weight: 500;
      margin: 0;
      max-width: 70%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    .group-date {
      font-size: 12px;
      color: #999;
      margin-top: 3px;
    }
    
    /* 新建按钮 */
    .create-btn {
      position: fixed;
      bottom: 20px;
      right: 20px;
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background-color: #3b82f6;
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
      text-decoration: none;
      z-index: 90;
    }
    
    /* 空状态 */
    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 60px 20px;
      text-align: center;
    }
    
    .empty-icon {
      font-size: 60px;
      margin-bottom: 20px;
      color: #cbd5e1;
    }
    
    .empty-text {
      font-size: 16px;
      margin: 0 0 10px 0;
    }
    
    .empty-subtext {
      font-size: 14px;
      color: #94a3b8;
      margin: 0 0 20px 0;
    }
    
    .empty-btn {
      padding: 8px 16px;
      background-color: #3b82f6;
      color: white;
      border: none;
      border-radius: 8px;
      font-size: 14px;
      cursor: pointer;
    }
    
    /* 提示框 */
    .toast {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      background-color: rgba(0,0,0,0.8);
      color: white;
      border-radius: 8px;
      padding: 10px 15px;
      font-size: 14px;
      z-index: 1000;
      display: none;
    }
  </style>
</head>
<body>
  <!-- 提示框 -->
  <div class="toast" id="toast"></div>
  
  <!-- 新建文章按钮 -->
  <a href="#" class="create-btn" id="createBtn">
    <i class="fa fa-plus"></i>
  </a>
  
  <!-- 顶部导航 -->
  <nav class="top-nav">
    <a href="#" class="nav-btn" id="backBtn">
      <i class="fa fa-angle-left"></i>
    </a>
    <h1 class="nav-title">文章管理</h1>
    <a href="#" class="nav-btn primary" id="searchBtn">
      <i class="fa fa-search"></i>
    </a>
  </nav>
  
  <!-- 文章概览 -->
  <div class="article-overview">
    <div class="overview-stats">
      <div class="stat-item">
        <div class="stat-value">24</div>
        <div class="stat-label">已发布</div>
      </div>
      <div class="stat-item">
        <div class="stat-value">8</div>
        <div class="stat-label">草稿</div>
      </div>
      <div class="stat-item">
        <div class="stat-value">2</div>
        <div class="stat-label">审核中</div>
      </div>
      <div class="stat-item">
        <div class="stat-value">128.5k</div>
        <div class="stat-label">总浏览</div>
      </div>
    </div>
  </div>
  
  <!-- 样式切换器 -->
  <div class="style-switcher">
    <div class="style-tabs">
      <div class="style-tab active" data-style="grid">网格卡片</div>
      <div class="style-tab" data-style="compact">紧凑列表</div>
      <div class="style-tab" data-style="expanded">扩展列表</div>
      <div class="style-tab" data-style="status">状态分组</div>
    </div>
  </div>
  
  <!-- 筛选栏 -->
  <div class="filter-bar">
    <div class="filter-item">全部分类</div>
    <div class="filter-item">全部状态</div>
    <div class="filter-item">最近30天</div>
  </div>
  
  <!-- 样式1 - 网格卡片视图 -->
  <div class="article-page active" id="grid">
    <div class="card-grid">
      <div class="article-card">
        <img src="https://picsum.photos/seed/article1/300/200" alt="文章缩略图" class="card-img">
        <div class="card-body">
          <h3 class="card-title">前端开发最新趋势分析</h3>
          <div class="card-meta">2023-06-15 · 1.2k浏览</div>
          <div class="card-footer">
            <span class="status-tag status-published">已发布</span>
            <div>
              <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
            </div>
          </div>
        </div>
      </div>
      
      <div class="article-card">
        <img src="https://picsum.photos/seed/article2/300/200" alt="文章缩略图" class="card-img">
        <div class="card-body">
          <h3 class="card-title">JavaScript性能优化技巧</h3>
          <div class="card-meta">2023-06-10 · 3.5k浏览</div>
          <div class="card-footer">
            <span class="status-tag status-published">已发布</span>
            <div>
              <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
            </div>
          </div>
        </div>
      </div>
      
      <div class="article-card">
        <img src="https://picsum.photos/seed/article3/300/200" alt="文章缩略图" class="card-img">
        <div class="card-body">
          <h3 class="card-title">React vs Vue：2023年对比</h3>
          <div class="card-meta">2023-06-05 · 5.8k浏览</div>
          <div class="card-footer">
            <span class="status-tag status-published">已发布</span>
            <div>
              <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
            </div>
          </div>
        </div>
      </div>
      
      <div class="article-card">
        <img src="https://picsum.photos/seed/article4/300/200" alt="文章缩略图" class="card-img">
        <div class="card-body">
          <h3 class="card-title">CSS Grid布局完全指南</h3>
          <div class="card-meta">未发布</div>
          <div class="card-footer">
            <span class="status-tag status-draft">草稿</span>
            <div>
              <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
            </div>
          </div>
        </div>
      </div>
      
      <div class="article-card">
        <img src="https://picsum.photos/seed/article5/300/200" alt="文章缩略图" class="card-img">
        <div class="card-body">
          <h3 class="card-title">WebAssembly入门教程</h3>
          <div class="card-meta">2023-05-28 · 2.1k浏览</div>
          <div class="card-footer">
            <span class="status-tag status-published">已发布</span>
            <div>
              <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
            </div>
          </div>
        </div>
      </div>
      
      <div class="article-card">
        <img src="https://picsum.photos/seed/article6/300/200" alt="文章缩略图" class="card-img">
        <div class="card-body">
          <h3 class="card-title">移动端适配最佳实践</h3>
          <div class="card-meta">审核中</div>
          <div class="card-footer">
            <span class="status-tag status-pending">审核中</span>
            <div>
              <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  
  <!-- 样式2 - 紧凑列表视图 -->
  <div class="article-page" id="compact">
    <ul class="article-list">
      <li class="list-item">
        <img src="https://picsum.photos/seed/article1/300/200" alt="文章缩略图" class="list-img">
        <div class="list-content">
          <h3 class="list-title">前端开发最新趋势分析</h3>
          <div class="list-meta">
            <span>2023-06-15</span>
            <span>1.2k浏览</span>
            <span class="status-tag status-published">已发布</span>
          </div>
        </div>
        <div class="list-actions">
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
          <button class="action-btn delete"><i class="fa fa-trash"></i></button>
        </div>
      </li>
      
      <li class="list-item">
        <img src="https://picsum.photos/seed/article2/300/200" alt="文章缩略图" class="list-img">
        <div class="list-content">
          <h3 class="list-title">JavaScript性能优化技巧</h3>
          <div class="list-meta">
            <span>2023-06-10</span>
            <span>3.5k浏览</span>
            <span class="status-tag status-published">已发布</span>
          </div>
        </div>
        <div class="list-actions">
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
          <button class="action-btn delete"><i class="fa fa-trash"></i></button>
        </div>
      </li>
      
      <li class="list-item">
        <img src="https://picsum.photos/seed/article3/300/200" alt="文章缩略图" class="list-img">
        <div class="list-content">
          <h3 class="list-title">React vs Vue：2023年对比</h3>
          <div class="list-meta">
            <span>2023-06-05</span>
            <span>5.8k浏览</span>
            <span class="status-tag status-published">已发布</span>
          </div>
        </div>
        <div class="list-actions">
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
          <button class="action-btn delete"><i class="fa fa-trash"></i></button>
        </div>
      </li>
      
      <li class="list-item">
        <img src="https://picsum.photos/seed/article4/300/200" alt="文章缩略图" class="list-img">
        <div class="list-content">
          <h3 class="list-title">CSS Grid布局完全指南</h3>
          <div class="list-meta">
            <span>未发布</span>
            <span class="status-tag status-draft">草稿</span>
          </div>
        </div>
        <div class="list-actions">
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
          <button class="action-btn delete"><i class="fa fa-trash"></i></button>
        </div>
      </li>
      
      <li class="list-item">
        <img src="https://picsum.photos/seed/article6/300/200" alt="文章缩略图" class="list-img">
        <div class="list-content">
          <h3 class="list-title">移动端适配最佳实践</h3>
          <div class="list-meta">
            <span>审核中</span>
            <span class="status-tag status-pending">审核中</span>
          </div>
        </div>
        <div class="list-actions">
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
          <button class="action-btn delete"><i class="fa fa-trash"></i></button>
        </div>
      </li>
    </ul>
  </div>
  
  <!-- 样式3 - 扩展列表视图 -->
  <div class="article-page" id="expanded">
    <div class="expanded-list">
      <div class="expanded-item">
        <div class="expanded-header">
          <h3 class="expanded-title">前端开发最新趋势分析</h3>
          <div class="expanded-meta">
            <div>2023-06-15 · 1.2k浏览</div>
            <span class="status-tag status-published">已发布</span>
          </div>
        </div>
        <div class="expanded-content">
          <p class="expanded-excerpt">本文分析了2023年前端开发领域的主要趋势，包括框架发展、工具链更新、性能优化和用户体验提升等方面的最新动态。</p>
        </div>
        <div class="expanded-footer">
          <div class="expanded-stats">
            <span><i class="fa fa-comment"></i> 32</span>
            <span><i class="fa fa-heart"></i> 156</span>
            <span><i class="fa fa-share-alt"></i> 24</span>
          </div>
          <div class="expanded-actions">
            <button class="action-btn preview"><i class="fa fa-eye"></i></button>
            <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
            <button class="action-btn delete"><i class="fa fa-trash"></i></button>
          </div>
        </div>
      </div>
      
      <div class="expanded-item">
        <div class="expanded-header">
          <h3 class="expanded-title">JavaScript性能优化技巧</h3>
          <div class="expanded-meta">
            <div>2023-06-10 · 3.5k浏览</div>
            <span class="status-tag status-published">已发布</span>
          </div>
        </div>
        <div class="expanded-content">
          <p class="expanded-excerpt">从代码层面到架构设计，本文总结了10个实用的JavaScript性能优化技巧，帮助开发者构建更高效的Web应用。</p>
        </div>
        <div class="expanded-footer">
          <div class="expanded-stats">
            <span><i class="fa fa-comment"></i> 58</span>
            <span><i class="fa fa-heart"></i> 243</span>
            <span><i class="fa fa-share-alt"></i> 67</span>
          </div>
          <div class="expanded-actions">
            <button class="action-btn preview"><i class="fa fa-eye"></i></button>
            <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
            <button class="action-btn delete"><i class="fa fa-trash"></i></button>
          </div>
        </div>
      </div>
      
      <div class="expanded-item">
        <div class="expanded-header">
          <h3 class="expanded-title">React vs Vue：2023年对比</h3>
          <div class="expanded-meta">
            <div>2023-06-05 · 5.8k浏览</div>
            <span class="status-tag status-published">已发布</span>
          </div>
        </div>
        <div class="expanded-content">
          <p class="expanded-excerpt">两大主流前端框架的深度对比，包括性能测试、API设计、生态系统、学习曲线和企业应用场景分析。</p>
        </div>
        <div class="expanded-footer">
          <div class="expanded-stats">
            <span><i class="fa fa-comment"></i> 124</span>
            <span><i class="fa fa-heart"></i> 389</span>
            <span><i class="fa fa-share-alt"></i> 92</span>
          </div>
          <div class="expanded-actions">
            <button class="action-btn preview"><i class="fa fa-eye"></i></button>
            <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
            <button class="action-btn delete"><i class="fa fa-trash"></i></button>
          </div>
        </div>
      </div>
    </div>
  </div>
  
  <!-- 样式4 - 状态分组视图 -->
  <div class="article-page" id="status">
    <!-- 已发布分组 -->
    <div class="status-group">
      <div class="group-header">
        <span>已发布</span>
        <span class="group-count">24</span>
      </div>
      <div class="group-content">
        <div class="group-item">
          <div>
            <h3 class="group-title">前端开发最新趋势分析</h3>
            <div class="group-date">2023-06-15 · 1.2k浏览</div>
          </div>
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
        </div>
        
        <div class="group-item">
          <div>
            <h3 class="group-title">JavaScript性能优化技巧</h3>
            <div class="group-date">2023-06-10 · 3.5k浏览</div>
          </div>
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
        </div>
        
        <div class="group-item">
          <div>
            <h3 class="group-title">React vs Vue：2023年对比</h3>
            <div class="group-date">2023-06-05 · 5.8k浏览</div>
          </div>
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
        </div>
      </div>
    </div>
    
    <!-- 草稿分组 -->
    <div class="status-group">
      <div class="group-header">
        <span>草稿</span>
        <span class="group-count">8</span>
      </div>
      <div class="group-content">
        <div class="group-item">
          <div>
            <h3 class="group-title">CSS Grid布局完全指南</h3>
            <div class="group-date">最后编辑：今天</div>
          </div>
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
        </div>
        
        <div class="group-item">
          <div>
            <h3 class="group-title">TypeScript高级类型技巧</h3>
            <div class="group-date">最后编辑：3天前</div>
          </div>
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
        </div>
      </div>
    </div>
    
    <!-- 审核中分组 -->
    <div class="status-group">
      <div class="group-header">
        <span>审核中</span>
        <span class="group-count">2</span>
      </div>
      <div class="group-content">
        <div class="group-item">
          <div>
            <h3 class="group-title">移动端适配最佳实践</h3>
            <div class="group-date">提交于：昨天</div>
          </div>
          <button class="action-btn edit"><i class="fa fa-pencil"></i></button>
        </div>
      </div>
    </div>
  </div>
  
  <!-- 空状态示例 (默认隐藏) -->
  <div class="empty-state" style="display: none;">
    <div class="empty-icon">
      <i class="fa fa-file-text-o"></i>
    </div>
    <h3 class="empty-text">暂无文章</h3>
    <p class="empty-subtext">您还没有创建任何文章，开始撰写第一篇吧</p>
    <button class="empty-btn">新建文章</button>
  </div>
  
  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // 获取元素
    const styleTabs = document.querySelectorAll('.style-tab');
    const articlePages = document.querySelectorAll('.article-page');
    const filterItems = document.querySelectorAll('.filter-item');
    const actionBtns = document.querySelectorAll('.action-btn');
    const backBtn = document.getElementById('backBtn');
    const searchBtn = document.getElementById('searchBtn');
    const createBtn = document.getElementById('createBtn');
    const toast = document.getElementById('toast');
    
    // 样式切换
    styleTabs.forEach(tab => {
      tab.addEventListener('click', function() {
        // 移除所有激活状态
        styleTabs.forEach(t => t.classList.remove('active'));
        articlePages.forEach(page => page.classList.remove('active'));
        
        // 设置当前激活状态
        this.classList.add('active');
        const style = this.getAttribute('data-style');
        document.getElementById(style).classList.add('active');
        
        showToast(`已切换到${this.textContent}`);
      });
    });
    
    // 筛选项点击事件
    filterItems.forEach(item => {
      item.addEventListener('click', function() {
        showToast(`筛选：${this.textContent}`);
        // 实际应用中可打开筛选弹窗
      });
    });
    
    // 操作按钮点击事件
    actionBtns.forEach(btn => {
      btn.addEventListener('click', function() {
        let action;
        if (this.classList.contains('edit')) action = '编辑';
        else if (this.classList.contains('delete')) action = '删除';
        else if (this.classList.contains('preview')) action = '预览';
        
        const titleElement = this.closest('.article-card, .list-item, .expanded-item, .group-item')
          .querySelector('.card-title, .list-title, .expanded-title, .group-title');
        const title = titleElement.textContent;
        
        if (action === '删除') {
          if (confirm(`确定要删除 "${title}" 吗？`)) {
            showToast(`已${action} "${title}"`);
          }
        } else {
          showToast(`正在${action} "${title}"`);
        }
      });
    });
    
    // 返回按钮点击事件
    backBtn.addEventListener('click', function() {
      showToast('返回上一页');
      // 实际应用中可以使用history.back()
    });
    
    // 搜索按钮点击事件
    searchBtn.addEventListener('click', function() {
      showToast('搜索文章');
    });
    
    // 新建按钮点击事件
    createBtn.addEventListener('click', function() {
      showToast('创建新文章');
    });
    
    // 显示提示
    function showToast(message) {
      toast.textContent = message;
      toast.style.display = 'block';
      
      setTimeout(() => {
        toast.style.display = 'none';
      }, 2000);
    }
  </script>
</body>
</html>
